<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title>置顶单页</title>
		<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0" />
		<!--ios是否运行创建快捷启动方式-->
		<meta content="yes" name="apple-mobile-web-app-capable">
		<!--ios顶部通知栏的样式 黑色-->
		<meta content="black" name="apple-mobile-web-app-status-bar-style">
		<!--遇到数字不让转成电话号码格式-->
		<meta content="telephone=no" name="format-detection">
		<script src="js/remstyle.js"></script>
		<link rel="stylesheet" href="assets/mui/css/mui.min.css">
		<link rel="stylesheet" type="text/css" href="common/css/base.css" />
		<link rel="stylesheet" type="text/css" href="css/min_page.css" />
		<link rel="stylesheet" type="text/css" href="css/sameInfo.css" />
		<link rel="stylesheet" type="text/css" href="css/collect_list.css" />
		<script type="text/javascript" src="js/vue.js"></script>
		<script type="application/javascript " src="js/jquery-1.7.2.min.js "></script>
		<script src="layer/layer.js"></script>
		<link rel="stylesheet" type="text/css" rel="stylesheet" type="text/css" href="layer/skin/layer.css" />
		<script src="js/config.js"></script>
		<link rel="stylesheet" type="text/css" href="font-awesome-4.7.0/css/font-awesome.css" />
	</head>
	<style>
		
	</style>

	<body>
		<!--顶部-->
		<div class="top">
			<div class="top-one" onclick="javascript :history.back(-1);">
				<span><img src="img_page/right.png"/></span>
			</div>
			<div class="point">
				<img src="img_page/3point.png" />
			</div>
		</div>
		<!--内容-->
		<div class="collect_con">
			<div class="collect_list" v-for="(v,index) in collect_list" >
				<div class="all_left" v-bind:class="{'new_all_left':isShow[index]}">
					<div class="collect_list_top" @click="linkTo(v.id)">
						<span class="collect_list_top_left">{{v.title}}</span>
						<img class="collect_list_top_right" :src="v.img_url" />
					</div>
					<div class="collect_list_bottom">
						<span class="collect_list_time">{{v.create_time}}</span>
						<button id="sideslip" style="opacity: 0;"><img class="collect_list_bottom_img" src="img_page/collect_right.png"/></button>

					</div>

				</div>

				<!--<div class="collect_list_edit" v-show="isShow" v-bind:class="{'new_collect_list_edit':isShow[index]}">
					<div class="collect_list_edit_con">

						<img class="collect_love" src="img_page/collect_love.png" />
						<img class="no_love" src="img_page/no_collect.png" />
						<span class="no_collect">收藏</span>
						<span class="my_collect">取消收藏</span>
					</div>
					<div class="collect_list_edit_top">
						<img class="collect_top" src="img_page/collect_top.png" />
						<span>置顶</span>
					</div>

				</div>-->

			</div>

		</div>
	</body>
	<script>
		var collect_list = new Vue({
			el: '.collect_con',
			data: {
				collect_list: [],
				isShow:true,
				page:1,
				current:''
			},
			created: function() {
				this.getList();
				window.addEventListener('scroll', this.onScroll);
			},
			methods:{
				onScroll:function() {
					//可滚动容器的高度
					var that = this;
					let innerHeight = document.querySelector('.collect_con').clientHeight; //屏幕尺寸高度
					let outerHeight = document.documentElement.clientHeight; //可滚动容器超出当前窗口显示范围的高度
					var scrollTop;
					if(typeof window.pageYOffset != 'undefined') { //pageYOffset指的是滚动条顶部到网页顶部的距离
						scrollTop = window.pageYOffset;
					} else if(typeof document.compatMode != 'undefined' && document.compatMode != 'BackCompat') {
						scrollTop = document.documentElement.scrollTop;
					} else if(typeof document.body != 'undefined') {
						scrollTop = document.body.scrollTop;
					}
					//console.log(innerHeight + " " + outerHeight + " " + scrollTop);
					if(innerHeight < (outerHeight + scrollTop)) { //加载更多操作
						console.log("加载中");
						//this.items += 10;

						that.page = ++that.page
						that.getList()
							//layer.closeAll();
					}
				},
				linkTo:function(num){
					window.location.href = "page_text_details.html?url="+num+"&c_user_id="+c_user_id;
				},
				getList: function() {
					var that = this;
					$.ajax({
						type: "get",
						url: v_url + "/wechat/singlepage/getTopPageList",
						data: {
							page: that.page,
							rows: '10',
							c_user_id:c_user_id
						},
						async: false,
						success: function(res) {
							var list = res.data;
							var new_collect_list = [];
							for(var i = 0; i < list.length; i++) {
									new_collect_list.push(list[i]);
									var create_time = list[i]["create_time"];
									var dateee = new Date(create_time).toJSON();
									var date = new Date(+new Date(dateee) + 8 * 3600 * 1000).toISOString().replace(/T/g, ' ').replace(/\.[\d]{3}Z/, '');
									list[i]["create_time"] = date;
									console.log(new_collect_list,123)

								}
							
//							that.collect_list = list
							//console.log(list);
							new_collect_list = that.collect_list;
							if(list && list.length != 0) {

								
								for(var i = 0; i < list.length; i++) {
									new_collect_list.push(list[i]);
								}
								that.collect_list = new_collect_list
								console.log(new_collect_list);
								if(list.length < 10) {

								}
							}
							var arr=new Array();
							for(var i=0;i<list.length;i++){
								arr.push(false);
							}
							that.isShow=arr
							//console.log(arr);
							

						}
					});

				},
			}
		})

		
	</script>
	</script>

</html>